package com.zlyx.easy.web.web.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zlyx.easy.core.annotations.Desc;
import com.zlyx.easy.core.model.Page;
import com.zlyx.easy.log.loggers.Logger;
import com.zlyx.easy.log.loggers.LoggerFactory;
import com.zlyx.easy.web.web.mybatis.AbstractMapper;

/**
 * @Auth 赵光
 * @Describle
 * @Date 2019年1月4日 下午9:04:02
 */
public interface AbstractService<M extends AbstractMapper<T>, T> extends IService<T> {

	public static Logger logger = LoggerFactory.getLogger(AbstractService.class);

	@Desc("不带总数的分页")
	public List<T> pageNoTotal(String sql, int pageSize, int pageNum);

	@Desc("分页")
	public Page<T> page(String sql, int pageSize, int pageNum);

	@Desc("查询")
	public List<T> select(String sql);

	@Desc("查询")
	public T selectOne(String sql);

	@Desc("查询")
	public long selectCount(String sql);

	@Desc("更新")
	public boolean update(String sql);

	@Desc("更新")
	public boolean updateByIds(List<Object> ids, String sqlFragment);

	@Desc("删除")
	public boolean delete(String sql);

	@Desc("删除")
	public boolean deleteByIds(List<Object> ids);

	@Desc("新增")
	public boolean insert(String sql);

}
